#pragma once

#pragma unmanaged

#include <BWSAL\MacroTask.h>

#pragma managed

#include "Build.h"

namespace BroodWar
{
	namespace Addon
	{
		ref class Task;
		
		public ref class MacroTask
		{
		internal:
			bool dispose;
			BWSAL::MacroTask* instance;

			MacroTask(BWSAL::MacroTask* task);
			~MacroTask();
			!MacroTask();
		public:
			MacroTask(BuildType type, int priority, bool isAdditional, int count);
			MacroTask(BuildType type, int priority, bool isAdditional, int count, TilePosition^ seedLocation);

			property List<Task^>^ Tasks { List<Task^>^ get(); }
			property Build^ Type { Build^ get(); }
			property bool IsAdditional { bool get(); }
			property bool IsCompleted { bool get(); }
			property int Count { int get(); }
			property TilePosition^ SeedLocation { TilePosition^ get(); }
			property int Priority { int get(); }
			property int RemainingCount { int get(); void set(int value); }
			property int WaitingCount { int get(); }
			property int IncompleteCount { int get(); }
			int ComputeRemainingCount();
			property Task^ NextUnscheduledTask { Task^ get(); }
		};

		MacroTask^ ConvertMacroTask(BWSAL::MacroTask* task);
		BWSAL::MacroTask* ConvertMacroTask(MacroTask^ task);
	}
}
